<template>
	<view class="content">
			<view class="postings basic">
				<view class="post_title">
					<text>基本信息</text>
					<text></text>
				</view>
				<view class="post_con">
					<text>企业名称</text>
					<text>{{nullStr(info.enterpriseName)}}</text>
				</view>
				<view class="post_con">
					<text>法人</text>
					<text>{{info.legalPerson}}</text>
				</view>
				<view class="post_con">
					<text>类别</text>
					<text>{{info.enterpriseType}}</text>
				</view>
				<view class="post_con">
					<text>联系方式</text>
					<text>{{info.legalPhone}}</text>
				</view>
				<view class="post_con">
					<text>注册时间</text>
					<text>{{info.registrationDate | date('yy-mm-dd')}}</text>
				</view>
			</view>
			<view class="" style="padding-left: 32rpx;color: #666;padding-bottom: 30rpx;">
				租赁信息
			</view>
			<u-collapse>
					<u-collapse-item class="zp-col" :title="`${ $u.timeFormat(item.rentFreeBeginDate,'yy-mm-dd')}到${ $u.timeFormat(item.rentFreeEndDate,'yy-mm-dd')}`" v-for="(item, index) in recordList" :key="index">
							<view class="xb-info">
								<view class="ti">
									房源信息
								</view>
								<template v-for="(item1,index1) in item.roomVOList">
									<view>
										<text>房源编号</text>
										<text>{{item1.roomNum}}-{{item1.floor}}层</text>
									</view>
									<view>
										<text>合同面积</text>
										<text>{{item1.contractArea}}</text>
									</view>
								</template>

								<view class="ti">
									租赁费用
								</view>
								<view>
									<text>租赁时间</text>
									<text>{{item.feOffice.rentBeginDate| date('yy-mm-dd')}}/{{item.feOffice.rentEndDate| date('yy-mm-dd')}}</text>
								</view>
								<view>
									<text>免租时间</text>
									<text>{{item.feOffice.rentFreeBeginDate| date('yy-mm-dd')}}/{{item.feOffice.rentFreeEndDate| date('yy-mm-dd')}}</text>
								</view>
								<view>
									<text>计费模式</text>
									<text>{{item.feOffice.calculationMode}}</text>
								</view>
								<view>
									<text>是否生效</text>
									<text>{{item.feOffice.effect?'是':'否'}}</text>
								</view>
								<view>
									<text>当前费用</text>
									<text>{{item.feOffice.price}}</text>
								</view>
								<view>
									<text>租金</text>
									<text>{{item.feOffice.firstYearRental}}/{{item.feOffice.secondYearRental}}/{{item.feOffice.thirdYearRental}}/{{item.feOffice.fourthYearRental}}/{{item.feOffice.fifthYearRental}}</text>
								</view>

								<view class="ti">
									设施费用
								</view>
								<view>
									<text>租赁时间</text>
									<text>{{item.feFacility.rentBeginDate| date('yy-mm-dd')}}/{{item.feFacility.rentEndDate| date('yy-mm-dd')}}</text>
								</view>
								<view>
									<text>免租时间</text>
									<text>{{item.feFacility.rentFreeBeginDate| date('yy-mm-dd')}}/{{item.feFacility.rentFreeEndDate| date('yy-mm-dd')}}</text>
								</view>
								<view>
									<text>计费模式</text>
									<text>{{item.feFacility.calculationMode}}</text>
								</view>
								<view>
									<text>是否生效</text>
									<text>{{item.feFacility.effect?'是':'否'}}</text>
								</view>
								<view>
									<text>当前费用</text>
									<text>{{item.feFacility.price}}</text>
								</view>
								<view>
									<text>租金</text>
									<text>{{item.feFacility.firstYearFacilityFee}}/{{item.feFacility.secondYearFacilityFee}}/{{item.feFacility.thirdYearFacilityFee}}/{{item.feFacility.fourthYearFacilityFee}}/{{item.feFacility.fifthYearFacilityFee}}</text>
								</view>

								<view class="ti">
									保证金
								</view>
								<view>
									<text>金额</text>
									<text>{{item.feSurety.surety}}</text>
								</view>
								
								<view class="ti">
									物业费用
								</view>
								<view>
									<text>金额</text>
									<text>{{item.feProperty.feeStandard}}</text>
								</view>

							</view>
					</u-collapse-item>
			</u-collapse>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info:{},
				enterId:'',
				roomVOList:[],
				recordList:[]
			};
		},
		onLoad(option) {
			this.getTitle(option.name)
			this.getInfo(option.id)
		},
		methods: {
			getInfo(id){
				let that=this
				//联网加载数据
				this.apis.businessApi.qyEnterprise(id).then(res => {
					this.info=res.data
					this.recordList=res.data.recordList
					let recordList=res.data.recordList
					console.log("recordList",recordList);
					// for (let i = 0; i < recordList.length; i++) {
					// 	roomVOList=roomVOList.concat(recordList[i].roomVOList)
					// }
					// this.roomVOList=roomVOList
				}).catch(()=>{
					//联网失败的回调,隐藏下拉刷新的状态
				})
			},
			getTitle(title) {
				uni.setNavigationBarTitle({
					title: title
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
$subheadColor:#111111;
$titleColor:#333333;
@mixin boldTitle {
	font-size: 28rpx;
	font-weight: 500;
	color: #666666;
}
@mixin  bordcon {
	font-size: 28rpx;
	color: #333333;
}
@mixin  padding {
			padding: 30rpx 0;
}
.content{
	padding: 20rpx;
	box-sizing: border-box;
	.rental_title{
			@include bordcon
			@include padding
			padding: 20rpx 32rpx;
	}
	.postings{
		display: flex;
		flex-direction: column;
		background: #FFFFFF;
		padding: 0 32rpx;
		margin-bottom: 20rpx;
		box-sizing: border-box;
		border-radius: 12rpx;
		.post_title{
			@include bordcon
			@include padding
			border-bottom: 1rpx solid #EEEEEE;
		}
		.post_con{
			display: flex;
			justify-content: space-between;
			@include padding
			text:nth-child(1){
				@include boldTitle
			}
			text:nth-child(2){
				@include bordcon
			}
			// 待租
			.rent{
				color: #F74D39 !important;
			}
			// 已租
			.occupancy{
				color: #44D94B !important;
			}
		}
	}
	.basic{
		.post_title{
			display: flex;
			justify-content: space-between;
			@include bordcon
			@include padding
			text:nth-child(2){
				@include boldTitle
			}
		}
		.post_con{
			display: flex;
			justify-content: space-between;
			border-bottom: 1rpx solid #EEEEEE;
			@include padding
			text:nth-child(1){
				@include boldTitle
			}
			text:nth-child(2){
				@include bordcon
			}
		}
		view:last-child{
			border-bottom: none;
		}
	}
	.facility{
		.post_con{
			border-bottom: 1rpx solid #EEEEEE;
			text:nth-child(2){
				@include bordcon
			}
		}
		view:last-child{
			border-bottom: none;
		}

	}
}

.zp-col{
	background: #FFFFFF;
	border-radius: 12rpx;
	margin-bottom: 30rpx;
	padding: 15rpx 32rpx;
	.xb-info{
		padding: 15rpx 0;
		text{
			color: #999;
		}
		text:last-child{
				color: #333;
		}
		.ti{
			color: #000;
		}
	}
	view:last-child{
		margin-bottom: 0;
	}
}

</style>
